package com.example.flshtarvel.mapper;

import com.example.flshtarvel.entity.Image;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ImageMapper {

    @Insert("insert into image(image_id,image_url,image_name,article_id) values(#{imageId},#{imageUrl},#{imageName},#{articleId})")
    public int insertImage(Image image);

    //根据信息id查询图片
    @Select("select * from image where article_id=#{articleId}")
    public List<Image> selectImageByArticleId(String articleId);

    @Delete("delete from image where image_id=#{imageId}")
    public int deleteImage(String imageId);
}
